// DBConvertDlg.h : header file
//

#if !defined(AFX_DBCONVERTDLG_H__A173AD4D_5D8B_44E7_9381_48B8C4913251__INCLUDED_)
#define AFX_DBCONVERTDLG_H__A173AD4D_5D8B_44E7_9381_48B8C4913251__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CDBConvertDlg dialog

class CDBConvertDlg : public CDialog
{
// Construction
public:
	void CreatePhsTabledataFromEhs();
	void DBConvertEHS2PHS_SA(_ConnectionPtr pCon);
	const CString GetDBPath();
	void RemoveFieldFromAllTable(CString dbName,CString strFieldName);
	void AddFieldsToAllTableOfDB(CString strDbName,CString strAddFieldsSQL);
	BOOL ConvertAllDb(long dVer, CString Pwd);
	BOOL ConVertDB(CString sDBN, CString dDBN, long dVer, CString Pwd="");
	CDBConvertDlg(CWnd* pParent = NULL);	// standard constructor
	~CDBConvertDlg();
// Dialog Data
	//{{AFX_DATA(CDBConvertDlg)
	enum { IDD = IDD_DBCONVERT_DIALOG };
	CProgressCtrl	m_progress2;
	CProgressCtrl	m_progress1;
	CListCtrl	m_list;
	CString	m_strSourceDBdir;
	int		m_bPromptSuccess;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDBConvertDlg)
	public:
	virtual BOOL DestroyWindow();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CDBConvertDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnButton1();
    afx_msg void OnSf(UINT uID);
	afx_msg void OnOpenButton();
	afx_msg void OnExitButton();
	afx_msg void OnButtonAddField();
	afx_msg void OnButton2();
	afx_msg void OnCreateConstantSpringDl();
	afx_msg void OnButtonLisega();
	afx_msg void OnczConstMENUITEM();
	afx_msg void OnButton3();
	afx_msg void OnsyConstMENUITEM();
	afx_msg void OnButton4();
	afx_msg void OnButtonEhs2phs();
	afx_msg void OnButtonPhsEhsFieldname();
	afx_msg void OnButtonPhsEhsFieldnamefind();
	afx_msg void OnButton5();
	afx_msg void OnCreateSySy0();
	afx_msg void OnCreateDlgb2010Zd2010();
	afx_msg void OnCreateHdcrude2010();
	afx_msg void OnTableRecordcount();
	afx_msg void OnAddPropertyToMaterialMdb();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	bool CreateNewCrudePAfix(_ConnectionPtr pCon, CString strSourceTable, CString strControl);
	bool CreateNewCrude(_ConnectionPtr pCon,CString strSourceTable,CString strControl);
	bool CreateNewCrude1(_ConnectionPtr pCon,CString strSourceTable);
	bool ConvertData_JSSY_2007();
	bool ConvertData_JSSY_2010(CString strTableNameTag);
	afx_msg void OnBnClickedGetDbpath();
	afx_msg void OnFaostat();
	afx_msg void OnBnClickedFaostat();
	afx_msg void OnNMCustomdrawProgress1(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnBnClickedFaostatProductionArea();
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DBCONVERTDLG_H__A173AD4D_5D8B_44E7_9381_48B8C4913251__INCLUDED_)
